static void
wr_deinit(void)
{
+ // pdb_close() will only free appinfo in read mode, and pdb_create() sets the mode to write.
+ struct appinfo* ai = (struct appinfo*) file_out->appinfo;
pdb_close(file_out);
+ if (ai) {
+ free(ai);
+ }
}
/* helpers */
-static char*
+static QString
coto_get_icon_descr(int category, const appinfo_t* app)
{
char buff[CATEGORY_NAME_LENGTH + 1] = "Not Assigned";
strncpy(buff, app->categories[category], sizeof(buff) - 1);
if (buff[0] == '\0') {
- return NULL;
+ return QString();
}
}
- return xstrdup(buff);
+ return QString(buff);
}
static void
int id;
int route_id;
char* title;
- char* category;
+ QString category;
double lat, lon, alt;
char* datestr, *timestr;
int icon;
fatal(MYNAME ": Premature EOD processing field 5 (Category).\n");
}
category = p;
+ xfree(p);
/* Field 6: Latitude */
p = field(&vdata, &vlen);
// that describes a sub-status
switch (w.status) {
case 0: // Waypoint not used. So why do we have one?
+ waypt_free(wpt);
break;
case 1: // Waypoint permanent.
case 2: // Waypoint temporary.
case 17: // Waypoint group body.
case 63: // Waypoint group invalid.
default:
+ waypt_free(wpt);
break;
}
}
if (attrv->hasAttribute("icon")) {
- wpt->icon_descr = xstrdup(attrv->value("icon").toString().toUtf8().constData());
+ wpt->icon_descr = attrv->value("icon").toString();
}
}
}